﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KMrpt15.aspx.cs" Inherits="KMrpt15" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>季节系列库销情况分析</title>
    <script src="js/extTools.js" type="text/javascript"></script>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-column-header-inner
        {
            height: 28px;
            background: #E7EBEF url(./images/header.png) repeat-x 0 0;
        }
    </style>
    <script>
        var areachange = function (obj) {
            //alert(obj.value);
            CompanyX.binStock(obj.value);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Neptune" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server" Layout="Container">
                            <Items>
                                <ext:Toolbar ID="Toolbar3" runat="server">
                                    <Items>
                                        <ext:DateField runat="server" ID="txtbdate" FieldLabel="日期" />
                                        <ext:Label ID="Label1" runat="server" Text="-">
                                        </ext:Label>
                                        <ext:DateField runat="server" ID="txtedate" />
                                        <ext:MultiCombo runat="server" ID="txtarea" FieldLabel="地区" DisplayField="OperationAreaName"
                                            ValueField="OperationAreaID">
                                            <Store>
                                                <ext:Store runat="server" ID="st_area">
                                                    <Model>
                                                        <ext:Model ID="Model1" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="OperationAreaID" />
                                                                <ext:ModelField Name="OperationAreaName" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                            <Listeners>
                                                <Change Fn="areachange" />
                                            </Listeners>
                                        </ext:MultiCombo>
                                        <ext:MultiCombo runat="server" ID="txtstock" FieldLabel="库存仓" DisplayField="stockname"
                                            ValueField="stockid">
                                            <Store>
                                                <ext:Store runat="server" ID="st_stock">
                                                    <Model>
                                                        <ext:Model ID="Model6" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="stockid" />
                                                                <ext:ModelField Name="stockname" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                        </ext:MultiCombo>
                                    </Items>
                                </ext:Toolbar>
                                <ext:Toolbar ID="Toolbar4" runat="server">
                                    <Items>
                                        <ext:MultiCombo runat="server" ID="txtseason" FieldLabel="季节" DisplayField="seasonname"
                                            ValueField="seasonname">
                                            <Store>
                                                <ext:Store runat="server" ID="Store4">
                                                    <Model>
                                                        <ext:Model ID="Model4" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="seasonname" />
                                                                <ext:ModelField Name="seasonname" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                        </ext:MultiCombo>
                                        <ext:MultiCombo runat="server" ID="txtyear" FieldLabel="年份" DisplayField="yearno"
                                            ValueField="yearno">
                                            <Store>
                                                <ext:Store runat="server" ID="Store3">
                                                    <Model>
                                                        <ext:Model ID="Model3" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="yearno" />
                                                                <ext:ModelField Name="yearno" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                        </ext:MultiCombo>
                                        <ext:MultiCombo runat="server" ID="txtmatkind" FieldLabel="类别" DisplayField="kindname"
                                            ValueField="kindname">
                                            <Store>
                                                <ext:Store runat="server" ID="Store5">
                                                    <Model>
                                                        <ext:Model ID="Model5" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="kindname" />
                                                                <ext:ModelField Name="kindname" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                        </ext:MultiCombo>
                                        <ext:Label runat="server" Text="是否包含在途：" />
                                        <ext:Checkbox runat="server" ID="pathchk">
                                        </ext:Checkbox>
                                        <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info"
                                            Icon="Find">
                                            <DirectEvents>
                                                <Click Timeout="90000">
                                                    <EventMask ShowMask="true" Msg="加载中...">
                                                    </EventMask>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                                <ext:Toolbar ID="Toolbar2" runat="server">
                                    <Items>
                                        <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="排序区域:" Reorderable="false" />
                                        <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" Reorderable="false" />
                                    </Items>
                                    <Plugins>
                                        <ext:BoxReorderer ID="BoxReorderer1" runat="server">
                                            <Listeners>
                                                <Drop Handler="changeSortDirection(dragCmp, false);" />
                                            </Listeners>
                                        </ext:BoxReorderer>
                                        <ext:ToolbarDroppable ID="ToolbarDroppable1" runat="server">
                                            <CreateItem Fn="createItem" />
                                            <CanDrop Fn="canDrop" />
                                            <Listeners>
                                                <Drop Fn="doSort" />
                                            </Listeners>
                                        </ext:ToolbarDroppable>
                                    </Plugins>
                                </ext:Toolbar>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="100" OnReadData="RefreshDataSet"
                            OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model2" runat="server">
                                    <Fields>
                                        <ext:ModelField Name="季节" ServerMapping="Seasonname" Type="String" />
                                        <ext:ModelField Name="系列" ServerMapping="seriesname" Type="String" />
                                        <ext:ModelField Name="均价" ServerMapping="avgprice" Type="Float" />
                                        <ext:ModelField Name="销售量" ServerMapping="salQty" Type="Float" />
                                        <ext:ModelField Name="实际结算金额" ServerMapping="salSumAmt" Type="Float" />
                                        <ext:ModelField Name="零售金额" ServerMapping="salRelSumAmt" Type="Float" />
                                        <ext:ModelField Name="折扣" ServerMapping="zkl" Type="Float" />
                                        <ext:ModelField Name="毛利率" ServerMapping="mll" Type="Float" />
                                        <ext:ModelField Name="仓库库存量" ServerMapping="cQty" Type="Float" />
                                        <ext:ModelField Name="店铺库存量" ServerMapping="dQty" Type="Float" />
                                        <ext:ModelField Name="仓库库存额" ServerMapping="cInvCostAmt" Type="Float" />
                                        <ext:ModelField Name="店铺库存额" ServerMapping="dInvCostAmt" Type="Float" />
                                        <ext:ModelField Name="总库存额" ServerMapping="InvCostAmt" Type="Float" />
                                        <ext:ModelField Name="店存流转周" ServerMapping="dlzz" Type="Float" />
                                        <ext:ModelField Name="总存流转周" ServerMapping="zlzz" Type="Float" />
                                        <ext:ModelField Name="实际结算金额占比" ServerMapping="salAmtzb" Type="Float" />
                                        <ext:ModelField Name="总库存额占比" ServerMapping="cAmtzb" Type="Float" />
                                        <ext:ModelField Name="店铺库存额占比" ServerMapping="dAmtzb" Type="Float" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                    </ColumnModel>
                    <Features>
                        <ext:Summary ID="Summary1" runat="server">
                        </ext:Summary>
                    </Features>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                    </SelectionModel>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label2" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="100" />
                                        <ext:ListItem Text="200" />
                                        <ext:ListItem Text="500" />
                                        <ext:ListItem Text="1000" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="100" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel" Icon="PageExcel">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                    <Listeners>
                        <AfterLayout Handler="#{ToolbarDroppable1}.addDDGroup(this.child('headercontainer').reorderer.dragZone.ddGroup); doSort();"
                            Single="true" />
                    </Listeners>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
